function getHostList(num, priority, inputs) {
  const projects = [];
  let i = 0
  while(i < num) {
    let name, value = 0;
    name = inputs[i][0]
    for(let j = 1; j < inputs[i].length; j++) {
      value += (priority[j - 1] * inputs[i][j])
    }
    projects.push({
      name,
      value
    })
    i++
  }

  projects.sort((a, b) => {
    if (a.value !== b.value) {
      return b.value - a.value
    } else {
      if (a.name.toLowerCase() > b.name.toLowerCase()) {
        return 1
      } else {
        return -1
      }
    }
  })
  for(let i = 0; i < projects.length; i++) {
    console.log(projects[i]);
  }
}

getHostList(5,
  [8, 6, 2, 8, 6],
  [["Camila", 66, 70, 46, 158, 80],
  ["ABC", 66, 70, 46, 158, 80],
  ["victoria", 94, 76, 86, 189, 211],
  ["anthony", 29, 17, 83, 21, 48],
  ["emily", 53, 97, 1, 19, 218]])